package com.cloudree.gllib.frament;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.MotionEvent;

import com.cloudree.gllib.BaseActivity;
import com.cloudree.gllib.surface.BaseGLSurface;
import com.kvin.toolkit.activity.OnBindInit;

/**
 * Created by Administrator on 2017/10/10 0010.
 */
public class BaseFragment extends Fragment implements OnBindInit,BaseActivity.OnTouchListener {
    protected BaseGLSurface mSurface;
    private boolean isInitialized;

    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        isInitialized = false;
    }

    @Override
    public void onStart() {
        super.onStart();
        if (!isInitialized) {
            isInitialized = true;
            init();
        }
    }

    @Override
    public void init() {

    }

    @Override
    public void initNav() {

    }

    @Override
    public void initDialog() {

    }

    @Override
    public void loadingData() {

    }

    @Override
    public void onResume() {
        super.onResume();
        if (mSurface!=null){
            mSurface.onResume();
        }
    }

    @Override
    public void onPause() {
        super.onPause();
        if (mSurface!=null){
            mSurface.onPause();
        }
    }

    @Override
    public boolean onTouch(MotionEvent event) {
        return false;
    }
}
